<?php
namespace Blog\Controller;
use Think\Controller;
class FeedbackController extends Controller {


    public function feedback(){
        $this->display();
    }
    //建议反馈
    public function dofeedback(){
        $data=I('post.');
        $table=M('feedback');
        $res=$table->add($data);
        //验证码
        $Verify = new \Think\Verify();
        if (!$Verify->check($data['verify'])) {
            $this->error('验证码错误', U('Feedback/feedback'));
        }
        if ($res){
            $this->success('留言成功,24小时内管理员将处理',U('Index/index'));
        }else{
            $this->error();
        }
    }


    //验证码条件
    public function Verify(){
        $Verify = new \Think\Verify();
        $Verify->useImgBg = false;//背景图关闭
        $Verify->useCurve = false;//曲线关闭
        $Verify->useNoise = false;//杂点
        $Verify->fontSize = 20;//字体
        $Verify->length = 8;//位数
        $Verify->imageW = 400;//宽
        $Verify->imageH = 50;//高
        $Verify->entry();//执行
    }
}